# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=xmpp-dns
pkgver=0.2.4
pkgrel=16
pkgdesc="CLI tool to check XMPP SRV records"
url="https://salsa.debian.org/mdosch/xmpp-dns/"
arch="all"
license="BSD-2-Clause"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://salsa.debian.org/mdosch/xmpp-dns/-/archive/v$pkgver/xmpp-dns-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
export GOFLAGS="$GOFLAGS -modcacherw"

build() {
	go build -o xmpp-dns
}

check() {
	go fmt "$(go list ./... | grep -v /vendor/)"
	go vet "$(go list ./... | grep -v /vendor/)"
	go test "$(go list ./... | grep -v /vendor/)"
}

package() {
	install -Dm755 xmpp-dns -t "$pkgdir"/usr/bin/
}

sha512sums="
2e0b6b6bfd47a2d0b4a9809d0d0e80eda802503606f49421199ebd406a9dd66bf425a1247d4280bc43e182812a0a83047ef93c0f9c4152e7e421bcbac9489619  xmpp-dns-0.2.4.tar.gz
"
